import Vue from 'vue'
import Vuex from 'vuex'
import * as actions from './actions'
import * as getters from './getters'
import state from './state'
import mutations from './mutations'

Vue.use(Vuex)

const store =  new Vuex.Store({
  actions,
  getters,
  state,
  mutations
})

//热重载
// if(module.hot){
//   module.hot.accept([
//     './state.js',
//     './mutations.js',
//     './getters.js',
//     './actions.js'
//   ],()=>{
//     const newState = require('./state').default
//     const newMutation = require('./mutations').default
//     const newGetters = require('./getters').default
//     const newActions = require('./actions').default

//     store.hotUpdate({
//       state:newState,
//       mutations:newMutation,
//       getters:newGetters,
//       actions:newActions
//     })
//   })
// }

export default store